`eslint-plugin-import-x`, `eslint-plugin-n`,
`eslint-import-resolver-typescript`, and `prettier` were floating to
older versions because `yarn.lock` happened to hold them; the platform-
api-docs PR (#8012) added scoped resolutions to keep that frozen.
Bumping the four packages to the latest versions matching their semver
ranges removes the need for those resolutions and surfaces five
pre-existing lint issues that the older plugins didn't flag:
- `eslint-plugin-n@18` rejects `import.meta.dirname` in
`eslint.config.mjs:132` because the property is only stable in Node
22.16+/24+, while the repo's engines field is `^18.18 || >=20`.
Resolve `dirname(fileURLToPath(import.meta.url))` instead so the
config works on every supported Node version.
- `eslint-plugin-import-x@4.16` enables `no-named-as-default` by
default. `@metamask/api-specs` exports `MetaMaskOpenRPCDocument` as
both a named export and the default; switch the
`chain-agnostic-permission` import to the named form to avoid the
ambiguous reference.
- `import-x/no-extraneous-dependencies` now catches `@metamask/messenger`
in `react-data-query/src/createUIQueryClient.test.ts` and
`@metamask/keyring-controller` in `transaction-pay-controller/src/strategy/relay/hyperliquid-withdraw{,.test}.ts`.
Both packages already used these symbols at runtime/test time without
declaring them. Add them to the relevant `dependencies` /
`devDependencies` blocks.
`yarn dedupe` and `yarn constraints --fix` also rolled the
`messenger-cli` package's `prettier` range forward to match the new
root range. No behavior changes in any of the affected packages —
their tests all still pass at 100% coverage.
Summary
eslint-plugin-import-x,eslint-plugin-n,eslint-import-resolver-typescript, andprettierto the latest versions matching their semver ranges (4.6.1 → 4.16.2, 17.15.1 → 18.0.1, 3.10.1 → 4.4.4, 3.4.2 → 3.8.3).Why
PR #8012 (feat/messenger-docs-site) carries scoped resolutions for these four packages to keep
yarn lintdeterministic. Investigating those (per r3326274335) showed they aren't resolving a transitive-dep conflict —yarn whyconfirms each is consumed only by the root workspace. They exist purely to prevent the lockfile from drifting forward to plugin versions that the codebase hasn't been cleaned against.Bumping the plugins here and addressing the five resulting lint errors means #8012 can drop those resolutions without re-introducing CI failures, and main stays on current plugin versions going forward.
Changes
eslint.config.mjs:import.meta.dirnameis only stable in Node 22.16+/24+, but the repo'senginesfield is^18.18 || >=20.eslint-plugin-n@18'sno-unsupported-featuresrule catches this. Resolve the config dir throughdirname(fileURLToPath(import.meta.url))so the config works across the supported Node range.packages/chain-agnostic-permission/src/scope/constants.ts:eslint-plugin-import-x@4.16enablesno-named-as-defaultby default.@metamask/api-specsexportsMetaMaskOpenRPCDocumentas both a named export and the default; switch to the named-import form so the reference is unambiguous.packages/react-data-query/package.json: adds@metamask/messengertodevDependencies(used increateUIQueryClient.test.ts).packages/transaction-pay-controller/package.json: adds@metamask/keyring-controllertodependencies(used insrc/strategy/relay/hyperliquid-withdraw{,.test}.ts).packages/messenger-cli/package.json:yarn constraints --fixrolled itsprettierrange forward to match the new root range.Test plan
yarn lint:eslintis cleanyarn constraintsis cleanyarn dedupe --checkis cleanyarn lint:misc:checkis cleanchain-agnostic-permission,react-data-query,transaction-pay-controllertests pass at 100% coverageNote
Low Risk
Tooling and dependency-declaration changes only; no runtime auth, security, or payment logic changes.
Overview
Bumps root eslint tooling (
eslint-plugin-import-x,eslint-plugin-n,eslint-import-resolver-typescript, prettier) and refreshes yarn.lock so CI can stay on current plugin versions without pinned resolutions.eslint.config.mjs stops using
import.meta.dirname(Node 22.16+ only) and setstsconfigRootDirviadirname(fileURLToPath(import.meta.url))son/no-unsupported-featurespasses on the repo’s^18.18 || >=20engines.chain-agnostic-permission switches
@metamask/api-specsto a namedMetaMaskOpenRPCDocumentimport forimport-x/no-named-as-default. react-data-query and transaction-pay-controller declare@metamask/messenger(dev) and@metamask/keyring-controller(prod) where code already imported them. messenger-cli aligns its prettier devDependency with the root bump.Reviewed by Cursor Bugbot for commit 2bfbb91. Bugbot is set up for automated code reviews on this repo. Configure here.